using UnityEngine;

public class EntityState : MonoBehaviour
{
    [SerializeField] string animationBoolName;

    protected Animator animator;

    bool m_enabled = true;

    // ========================================================================

    public virtual bool Check() => m_enabled;

    public virtual void Enter() => animator.SetBool(animationBoolName, true);

    public virtual void Exit() => animator.SetBool(animationBoolName, false);

    public virtual void Process() { }

    public virtual void LateProcess() { }

    // ========================================================================

    public void SetEnabled(bool enabled) => m_enabled = enabled;
}
